<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>

var fCount = 3;
function addFileElement() {
	fCount++;
	var fObject = document.getElementById('fileSection');
	var text = 'File:';   
	var tag='<input type="file" name="file" />';   
	var brk='<br>'
	var o1 = document.createTextNode(text);
	var o2 = document.createElement(tag);
	var o3 = document.createElement(brk);
	fObject.appendChild(o3);
	fObject.appendChild(o1);
	fObject.appendChild(o2);
	fObject.appendChild(o3); 
}
</script>
<title>Multiple file upload using JAX-RS</title>
</head>
<body>
<form  action="jersey/uploadfile" method="POST" enctype="multipart/form-data">
<div id="fileSection" >
File:<input type="file" name="file" /><br>
File:<input type="file" name="file" /><br>
File:<input type="file" name="file" /><br>
</div>
<hr>
<input type="submit" value="Upload All files" />
<input type="hidden" name="catalog" value="IHM" />
<input type="button" onclick="addFileElement()" value="Add File"/>
</form>
</body>
</html>